<?php

namespace App\Lib\EmailAlert;

use App\Models\Issue;

class NewIssuePublishBTemplate extends Template
{

    private $issue;

    public function __construct($id=0)
    {
        if ($id) {
            $this->issue = Issue::find($id);
        } else {
            $this->issue = (new Issue())->currentIssue();
        }
    }


    public function subject()
    {
        return 'Zoological Research - Vol. ' . $this->issue->volume . ', Issue ' . $this->issue->issue . ' (' . $this->issue->year . ') now available';
    }

	public function body()
	{

		$currentIssue = $this->issue;
		$articles = $currentIssue->articles;
		$html = '<p style="margin-bottom:0px;">
    <img alt="" title="" src="' . asset('/images/zr_header.jpg') . '" width="1096" height="210"/>
</p>
<p style="width: 1086px;background-color:#076919; margin-top:-5px; padding: 10px 5px">
    <span style="font-size: 14px; color: #fff;">欢迎访问《动物学研究》网站（<a style="color: #fff;text-decoration: none;" href="www.zoores.ac.cn" target="_blank">www.zoores.ac.cn</a>）,&nbsp; 浏览更多精彩文章。</span><span style="color: #fff;float:right; font-size: 12px;">[<a target="_blank" href="http://www.zoores.ac.cn/EN/column/column79.shtml" style="color: #fff;text-decoration: none;"><strong>期刊简介</strong></a>] [<a target="_blank" style="color: #fff;text-decoration: none;" href="http://www.zoores.ac.cn/EN/column/column117.shtml"><strong>投稿须知</strong></a>] [<a style="color: #fff;text-decoration: none;" href="http://www.zoores.ac.cn/EN/column/column83.shtml" target="_blank"><strong>联系我们</strong></a>]</span>
 &nbsp; &nbsp; &nbsp; &nbsp;
</p>
<p>
    <br/>
</p>
<table width="1096">
    <tbody>
        <tr class="firstRow">
            <td style="border-width: 1px; border-style: solid; border-color:#ccc;padding: 20px;" valign="top">
                <p>
                    <span style="font-size: 14px;">Dear colleagues,</span>
                </p>
                <p style="text-indent: 2em;">
                    <span style="font-size: 14px;">It\'s my pleasure to present you the current issue of Zoological Research (ZR). Here, we would like to thank you all for your enduring support and faith. Let us combine our continued growth and evolution together to ensure ZR remains a respected publication platform.</span>
                </p>
                <p style="text-indent: 2em;">
                    <span style="font-size: 14px;">Your suggestions will be highly valued!</span>
                </p>
                <p style="text-indent: 0em;"></p>
                <p style="text-indent: 0em;">
                    <span style="font-size: 14px;">Sincerely yours,<br/></span>
                </p>
                <p style="text-indent: 0em;">
                    <img alt="" title="" src="' . asset('/images/qianming.jpg') . '" />
                </p>
                <p style="text-indent: 0em;">
                    <span style="font-size: 14px;">Yong-Gang YAO<br/>Editor-in-Chief</span>
                </p>
            </td>
            
        </tr>
        <tr>
            <td style="border-width: 1px; border-style: solid;padding: 20px;" valign="top">
                <p><span style="font-size: 18px; padding: 0px 4px 0px 0px; margin: 10px 0px 20px; color:#a90900;">Grow the possibilities of your publications in Zoological Research</span>
                </p><br>
                <p style="float: left;"><img src="' . asset('uploads/' . $currentIssue->cover) . '" width="158" height="208"/></p>
                <p style="float: left; padding-left:20px; width: 866px;">
                    <span style="">&nbsp;&nbsp;&nbsp;&nbsp;ZR combines the best of a new, high-growth journal and a time-tested, respected academic periodical. Currently, it serves as a key journal focusing on Primates and Animal Models, Conservation and Utilization of Animal Resources, and Animal Diversity and Evolution. The journal also publishes peer-reviewed original research articles, reports and reviews, as well as commentaries and letters to the editor.</span> <br><span style="">&nbsp;&nbsp;&nbsp;&nbsp;We also extend a special invitation to our colleagues to serve as single-issue Guest Editors, and if any author would like to advance a topic that is prospective, controversial and worth exploring, please feel free to <a href="http://www.zoores.ac.cn">contact us</a>.</span>
                </p>
                <br>
                <p style="text-align: right;"><a href="http://www.ncbi.nlm.nih.gov/pmc/" target="_blank"><img alt="" title="" src="' . asset('/images/dwyxpmclogo.gif') . '" /></a></p>
            </td>
        </tr>
        <tr>
            <td style="border-width: 1px; border-style: solid;padding: 20px;" width="896" valign="top">
                <span style="font-size: 18px; padding: 0px 4px 0px 0px; margin: 10px 0px 20px; color:#a90900;">' . $currentIssue->year . ', Volume ' . $currentIssue->volume . ' Issue ' . $currentIssue->issue . '</span>';

        foreach ($articles as $article) {
        	$html .= '<p style="padding: 10px 5px 5px 0px;font-size:14px;margin:0px;">
                    <a style="text-decoration: none; font-weight: bold; display:inline;font-size:13px; color:#969442;" target="_blank" href="' . route('article.index', ['id' => $article->id]) .  '"><u>' . $article->title . '</u></a></p>
                    <p style="font-size:13px;padding-top: 8px;"><a style="TEXT-DECORATION: none; COLOR: #a66000" href="" target="_blank"><b><i>Free</i></b> Full Text (Abstract)</a>     <a style="TEXT-DECORATION: none; COLOR: #a66000" href="" target="_blank"><b><i>Free</i></b> Full Text (Abstract)</a></p>
                    <p style="font-size:13px;"><span style="font-size:12px;display:inline; color:#666666;"><i>' . $article->pureAuthorList() . '</i></span></p>
                <p style="padding: 5px 0px 5px 0px;font-size:14px; margin:0px; color: #666666;">
                    <strong>Abstract:</strong>&nbsp;' . $article->abstract . '
                </p>';
        }

        $html .= '</td>
        </tr>
        <tr>
            <td style="border-width: 1px; border-style: solid;padding: 20px;" valign="top">
                <p style="float: left; width: 300px">Editorial Office of Zoological Research,<br>
Kunming Institute of Zoology,<br>
Chinese Academy of Sciences,<br>
32 Jiaochang Donglu,Kunming,<br>
Yunnan 650223,<br>
P. R. China.<br>
Tel: +86 871 65199026<br>
E-mail: <a href="mailto:zoores@mail.kiz.ac.cn">zoores@mail.kiz.ac.cn</a><br>
Homepage: <a href="http://www.zoores.ac.cn/">http://www.zoores.ac.cn/</a></p>
                <p style="float: left; padding-left:20px; width: 716px;"><a href="" target="_blank"><img alt="" title="" src="' . asset('/images/email/dongwuxueyanjiu1.jpg') . '" width="75" /></a>
    <a href="" target="_blank"><img width="75" alt="" title="" src="' . asset('/images/email/dongwuxueyanjiu2.jpg') . '" /></a>
    <a href="http://doaj.org/" target="_blank"><img width="75" alt="" title="" src="' . asset('/images/email/logo_cropped.jpg') . '" /></a>
    <a href="http://www.scopus.com/" target="_blank"><img width="75" alt="" title="" src="' . asset('/images/email/sco.png') . '" /></a><br>
    <a href="' . route('issue.current') . '" target="_blank"><img width="75" alt="" title="" src="' . asset('/images/email/dongwuxueyanjiu3.png') . '" /></a>
                </p>
            </td>
        </tr>
    </tbody>
</table>';

// <p style="font-size: 12px; margin: 0px;">
//     版权所有© 《动物学研究》编辑部 &nbsp;Tel: 0871-65199026 内线: 8224<br/>地址:昆明市教场东路32号 中国科学院昆明动物研究所 &nbsp;邮编：330045
// </p>

		return $html;
	}
}